import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;

public class getHouses extends HttpServlet
{
	public static dbapi conn;
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException
	{
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		conn = new dbapi();
		conn.connect();
		if(conn.connected)
			out.println("connected via dbapi <br>");
		else
		{
			out.println("CANT CONNECT! <br>");
			out.println(conn.msg + "<br>");
		}
		int ct = 0;
		
		ct = conn.getHomeCount();
		if(ct == -1)
			out.println("error: "+conn.msg + "<br>");
		else
			out.println("House Count in DB: " +ct);
	}
}
